<?php
//打开数据库
$coon=mysqli_connect('127.0.0.1','root','123456','scholl')or die(数据库连接失败);
var_dump($coon);
//关闭数据库
//mysqi_close($conn);
//执行sql语句
$result=mysqli_query($coon, 'select*from stu');
var_dump($result);
//读取数据
//$ret=mysqli_fetch_array($result);
//for($i=0;$i<$result->num_rows;$i++){
//	$ret=mysqli_fetch_array($result);
//	var_dump($ret);
//}
//var_dump($ret[1]);
//echo $ret["name"];
echo "<table border='1'>";
while($ret=mysqli_fetch_row($result)) {
	echo "<tr>";
	foreach($ret as $key){
	echo "<td>".$key."</td>";
	}
	echo "</tr>";
}
echo "</table>"
?>